import React from 'react'
import ReactDom from 'react-dom'
import { Provider } from 'react-redux'
import {createStore,applyMiddleware,compose} from 'redux'
import thunk from 'redux-thunk'
import { BrowserRouter, Route, Redirect,Switch } from 'react-router-dom'
import App from './App'
import A from './a'
import B from './b'
import {counter} from './index.redux'

//const store=createStore(counter,applyMiddleware(thunk))
const store = createStore(counter, compose(
	applyMiddleware(thunk),
	window.devToolsExtension?window.devToolsExtension():f=>f
))
ReactDom.render(
	(<Provider store={store}>
		<BrowserRouter>
			<div>
				<Switch>		
					<Route path='/app' component={App}></Route>
                    <Route path='/a' component={A}></Route>
                    <Route path='/b' component={B}></Route>
					<Route component={App}></Route>
				</Switch>

			</div>
		</BrowserRouter>
	</Provider>),
	document.getElementById('root')
)
